<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
	</head>
	<body>
		<form id="form1">
			<label>
				选择要上传的文件：
				<input type="file" name="uploadfile" id="uploadfile" />
			</label>
			<br />
			<input type="button" name="submit" value="上传" />
		</form>
		
		<script type="text/javascript">
			$(function(){
				$(':button').click(function(){
					$.ajax({
						type: 'post',
						url: '../upload',
						data: new FormData($('#form1')[0]),
						contentType: false,
						processData: false,
						success: function(data){
							console.log(data);
						}
					});
				});
			});
			
		</script>
	</body>
</html>
